//
//  RechargeViewController.m
//  Futures
//
//  Created by Cheng on 2017/7/19.
//  Copyright © 2017年 Cheng. All rights reserved.
//

#import "RechargeViewController.h"

@interface RechargeViewController ()

@property (weak, nonatomic) IBOutlet UITextField *rechargeMoney;
@property (weak, nonatomic) IBOutlet UIImageView *selectBank;
@property (weak, nonatomic) IBOutlet UIImageView *selectAlipay;

@end

@implementation RechargeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    
    self.title = @"充值";
    
//    [self addToolbarOnKeyboard:self.rechargeMoney];
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    if (indexPath.row == 0) {
        self.selectBank.hidden = NO;
        self.selectAlipay.hidden = YES;
    }else if (indexPath.row == 1){
        self.selectBank.hidden = YES;
        self.selectAlipay.hidden = NO;
    }
}
- (IBAction)clickNext:(id)sender {
    if (!self.selectBank.isHidden) {
        showAlert(@"暂未开放");
    }
    
    if (!self.selectAlipay.isHidden) {
        //    NSURL *url = [NSURL URLWithString:@"alipay://"];
        //    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        NSString* string = [NSString stringWithFormat:@"alipays://platformapi/startApp?saId=10000007&qrcode=%@",@"HTTPS://QR.ALIPAY.COM/FKX09868ZHHFO4DZWADC34"];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
        //    }else {
        //        showAlert(@"未安装支付宝");
        //    }
    }
}



@end
